package com.dhp.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dhp.model.dto.interfaceInfo.InterfaceInfoQueryRequest;
import com.dhp.model.dto.interfaceInfo.InvokeRequest;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dhp.model.dto.interfaceInfo.PublishInterfaceRequest;
import com.dhp.model.entity.InterfaceInfo;
import com.dhp.model.vo.InterfaceInfoVO;
import com.dhp.model.vo.UserInterfaceVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author Dhp
* @description 针对表【interface_info(接口信息)】的数据库操作Service
* @createDate 2024-07-26 16:28:17
*/
public interface InterfaceInfoService extends IService<InterfaceInfo> {

    /**
     * 校验
     *
     * @param interfaceInfo
     * @param add
     */
    void validInterfaceInfo(InterfaceInfo interfaceInfo, boolean add);

    /**
     * 获取查询条件
     *
     * @param interfaceInfoQueryRequest
     * @return
     */
    QueryWrapper<InterfaceInfo> getQueryWrapper(InterfaceInfoQueryRequest interfaceInfoQueryRequest);

    /**
     * 获取帖子封装
     *
     * @param interfaceInfo
     * @param request
     * @return
     */
    InterfaceInfoVO getInterfaceInfoVO(InterfaceInfo interfaceInfo, HttpServletRequest request);

    /**
     * 分页获取帖子封装
     *
     * @param interfaceInfoPage
     * @param request
     * @return
     */
    Page<InterfaceInfoVO> getInterfaceInfoVOPage(Page<InterfaceInfo> interfaceInfoPage, HttpServletRequest request);

    /**
     * 上线接口
     * @param publishInterfaceRequest
     * @return
     */
    Boolean publishInterface(PublishInterfaceRequest publishInterfaceRequest , HttpServletRequest request);

    /**
     * 下线接口
     * @param id
     * @return
     */
    Boolean offLineInterface(Long id);

    /**
     * 根据id获取接口信息
     * @param id
     * @return
     */
    InterfaceInfoVO getInterfaceById(Long id);

    /**
     * 在线调用接口
     * @param invokeRequest
     * @param request
     * @return
     */
    Object invokeInterface(InvokeRequest invokeRequest, HttpServletRequest request);
}
